package services

import (
	"bestcore/common/postgresql"
	"bestlyg/models"
)

var User = new(user)

type user struct{}

func (u *user) GetList() ([]models.User, error) {
	db := postgresql.Get()
	users := make([]models.User, 0)
	result := db.Table("zhy_usr").Find(&users)
	if result.Error != nil {
		return nil, result.Error
	} else {
		return users, nil
	}
}
